#version 450
#define OFFSET 1
#define SHADER_NAME fragment:depthBoxBlur
layout(set = 1, binding = 3) uniform LeftOver {
        vec2 scale;
    vec2 screenSize;
};

precision highp float;
// Internals UBO

layout(set = 1, binding = 0) uniform Internals {
float yFactor_;
float textureOutputHeight_;
};

layout(location = 0)  in vec2 vUV;
layout(set = 1, binding = 2) uniform sampler textureSamplerSampler;
                        layout(set = 1, binding = 1) uniform texture2D textureSamplerTexture;
                        #define textureSampler sampler2D(textureSamplerTexture, textureSamplerSampler)

#define CUSTOM_FRAGMENT_DEFINITIONS
layout(location = 0) out vec4 glFragColor;
void main(void)
{
vec4 colorDepth=vec4(0.0);
for (int x=-OFFSET;
x<=OFFSET;
x++)
for (int y=-OFFSET;
y<=OFFSET;
y++)
colorDepth+=texture(textureSampler,vUV+vec2(x,y)/screenSize);
glFragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));
}